package com.example.controller;

import com.example.service.EnvService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
public class ClientController {

    @Autowired
    private EnvService envService;

    @Value("${env}")
    private String env;


    @GetMapping("/testenv")
    public String testConfigUpdate(){
        return "env is "+ env +"; envservice is " + envService.getServiceEnv();
    }

}
